<?php

/**
 * Created by PhpStorm.
 * Author: ls
 * Time: 2023/8/17 15:32
 * Desc:拼团请求参数验证
 */
class Request_Api_V2_Together extends Request_Api_V2_Base
{
    public function __construct($request_param)
    {
        parent::__construct($request_param);
    }

    public function query()
    {
        $this->rules = [
            ['page', ['not_empty', 'digit', $this->rule_min(1)]],
            ['pagesize', ['not_empty', 'digit',$this->rule_min(1)]],
            ['status', [$this->rule_in_array([1, 2])]],
        ];

        return $this;
    }

    public function detail()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit']],
        ];

        return $this;
    }

    public function pending_join_list()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit']],
        ];

        return $this;
    }

    public function order_limit()
    {
        $this->rules = [
            ['id', ['not_empty', 'digit']],
        ];

        return $this;
    }

    public function get_member_join()
    {
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        $this->rules = [
            ['page', ['not_empty', 'digit', $this->rule_min(1)]],
            ['pagesize', ['not_empty', 'digit', $this->rule_min(1)]],
            ['type', ['digit', $this->rule_in_array([1, 2])]],
        ];

        return $this;
    }

    public function get_member_join_detail()
    {
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        $this->rules = [
            ['join_id', ['not_empty', 'digit', $this->rule_min(1)]]
        ];

        return $this;
    }

    public function get_share_info()
    {
        $this->validation->rule('mid',array('Rule_Member','need_member'));

        $this->rules = [
            ['join_id', ['not_empty', 'digit', $this->rule_min(1)]],
            ['come_from', ['not_empty']]
        ];

        return $this;
    }

}